﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

using Passion3DProject.src.About_the_Camera;

namespace Passion3DProject.src.Stuffs.About_Stages
{
    class Stage1 : Stage
    {
        private Player player;
        private GameObjectManager objManager;
        private GameObject ground;
        private FirstPersonCamera FirstPersonCamera;

        public Stage1(ContentManager content,GraphicsDeviceManager graphics)
            :base(content,graphics)
        {
        }


        protected override void LoadContent()
        {
            objManager = new GameObjectManager();

            player = new Player(Content, "caixa");
            ground = new GameObject(Content, "grounds");

            FirstPersonCamera = new FirstPersonCamera(Graphics);

            objManager.ObjectList.Add(ground);
            objManager.PlayerList.Add(player);
            ground.ScaleX = ground.ScaleY = ground.ScaleZ = 10;
            player.Position = new Vector3(0, 10, 0);
            player.LastPosition = player.Position;
        }


        public override void Update(GameTime gameTime)
        {
            player.Update(gameTime, FirstPersonCamera);
            FirstPersonCamera.Update(player.Position, player.moveVector);
            objManager.Update(gameTime);
        }


        public override void Draw()
        {
            objManager.Draw(FirstPersonCamera);
        }




    }
}
